Computational Vision
U. Minn. Psy 5036
Daniel Kersten
Lecture 13: Edge Detection

Initialize

Read in Statistical Add-in packages:

Off[General::spell1];
Needs["VectorFieldPlots`"]
<<MultivariateStatistics`

SetOptions[ArrayPlot,ColorFunction->"GrayTones",DataReversed->True,Frame->False,AspectRatio->Automatic,Mesh->False,PixelConstrained->True,ImageSize->Small];
SetOptions[ListPlot,ImageSize->Small];
SetOptions[Plot,ImageSize->Small];
SetOptions[DensityPlot,ImageSize->Small,ColorFunction->GrayLevel];
nbinfo=NotebookInformation[EvaluationNotebook[]];dir=("FileName"/.nbinfo/.FrontEnd`FileName[d_List,nam_,___]:>ToFileName[d]);

1) Define 64x64 pixel cup image (cup), or...

Evaluate this: cup

cup = {{232,233,233,232,231,231,232,233,231,231,231,231,231,231,229,228,228,225,225,226,224,223,222,221,221,220,220,219,217,217,217,214,213,212,212,212,213,214,216,217,216,215,215,216,216,215,214,215,214,214,215,217,217,216,217,219,220,218,219,221,221,223,225,223},{232,232,232,231,230,230,230,231,230,230,230,230,230,229,227,226,224,223,225,225,223,221,221,219,220,218,217,215,213,212,211,210,209,208,206,204,203,202,202,202,209,211,213,213,211,210,210,211,210,211,213,213,212,211,212,214,213,213,217,221,220,221,221,220},{231,232,231,231,229,229,229,230,229,229,229,228,227,226,225,224,224,223,223,221,218,218,217,215,216,214,215,215,213,210,208,206,205,205,203,201,199,197,197,196,192,196,199,202,203,204,205,205,206,206,205,205,207,209,211,211,212,212,215,218,217,217,219,220},{231,231,231,231,229,229,229,229,228,228,228,227,226,225,224,224,225,222,220,220,219,218,217,215,215,212,210,208,206,207,207,204,204,202,198,195,193,191,188,186,184,182,180,181,184,188,194,199,199,202,204,204,203,205,206,205,210,209,210,213,214,214,217,220},{230,230,230,230,229,228,227,227,227,227,226,225,224,223,223,223,222,218,218,220,218,214,213,212,212,211,210,206,202,200,195,187,178,171,160,152,145,138,131,127,126,123,122,126,131,135,144,153,171,182,194,197,196,197,201,204,204,204,206,210,213,214,214,216},{229,229,228,227,226,225,224,224,225,224,222,221,220,220,220,219,220,217,217,217,214,211,211,212,210,206,199,187,172,157,140,125,112,105,94,84,77,72,66,62,58,56,57,60,61,62,69,77,85,104,133,159,177,188,194,196,202,204,206,208,211,212,212,213},{228,228,227,226,224,223,221,220,221,219,217,216,215,215,214,214,215,213,213,212,211,211,208,203,192,176,155,137,119,104,94,86,80,78,76,74,73,72,71,69,66,62,56,49,43,39,38,38,44,48,60,82,111,143,169,185,193,199,203,204,207,210,211,213},{229,228,227,225,224,222,220,219,218,216,214,212,212,211,210,209,207,207,206,204,204,201,189,172,148,129,111,104,102,105,113,120,130,133,137,140,140,139,137,136,131,130,127,122,116,109,96,85,71,62,51,49,61,89,125,150,175,187,197,202,206,209,211,212},{229,228,227,226,224,222,220,219,218,216,214,212,211,209,207,205,203,200,200,195,192,183,157,137,117,115,123,141,156,163,167,168,163,161,157,152,148,145,142,141,138,137,136,135,134,135,135,135,134,130,117,101,84,73,93,129,144,170,191,200,202,211,213,213},{231,230,229,227,226,223,222,221,221,220,217,215,214,212,210,208,205,201,198,194,185,163,138,130,146,160,174,176,171,169,166,161,158,156,152,148,145,142,139,138,137,135,133,132,132,132,132,132,133,136,138,141,139,125,118,124,136,153,177,199,205,209,209,213},{233,233,232,230,228,226,225,224,221,220,219,218,217,216,214,213,209,209,203,194,178,157,155,169,181,179,176,171,166,164,162,158,157,154,150,147,145,143,140,139,136,134,132,130,130,130,129,129,131,131,129,131,137,141,144,148,146,150,167,195,207,211,211,212},{235,234,233,232,231,230,229,228,224,223,222,222,221,220,219,218,216,217,210,203,189,176,178,184,179,174,172,172,168,163,160,159,158,155,151,148,147,145,143,141,137,135,132,130,130,130,129,127,126,129,130,128,129,134,141,144,158,162,175,197,207,215,217,213},{235,235,234,233,233,232,232,232,231,231,230,229,228,227,225,224,222,223,222,217,199,185,184,176,177,177,176,171,166,166,166,163,158,155,151,148,147,145,142,141,138,135,132,131,130,130,129,127,128,128,129,129,129,133,139,141,151,167,188,208,210,215,219,217},{235,235,234,234,234,234,234,234,234,234,234,233,233,232,231,230,229,227,230,222,197,184,185,182,179,173,171,171,169,166,163,159,158,155,152,149,147,144,142,140,137,135,132,131,130,130,129,128,128,127,128,129,130,132,135,137,147,164,187,215,219,217,220,220},{235,235,235,234,234,235,235,235,233,233,234,235,235,235,234,234,235,230,230,218,197,188,185,181,182,175,173,174,169,164,164,166,158,157,154,151,148,145,143,141,137,135,133,131,130,130,129,129,129,130,130,130,132,134,139,143,152,162,179,213,226,222,222,223},{236,235,235,235,235,235,235,236,234,235,236,236,236,235,235,234,235,237,237,216,195,189,186,186,179,179,177,172,169,169,165,158,158,157,154,152,149,146,143,141,137,135,133,132,131,130,130,130,129,131,130,129,133,136,138,141,151,161,176,210,226,224,224,226},{235,235,235,235,235,235,235,235,235,234,234,235,235,235,235,235,235,233,238,211,197,193,188,186,181,178,175,172,168,166,164,162,158,156,154,150,147,144,142,140,139,137,134,131,131,130,130,129,129,130,130,132,133,133,137,143,152,162,178,206,230,226,226,227},{234,234,235,235,235,235,235,235,235,237,236,234,234,234,235,236,234,236,237,215,197,192,190,186,182,178,176,172,168,166,164,161,158,156,153,150,147,145,142,141,138,136,134,132,131,130,129,128,128,130,130,132,134,134,138,144,152,163,178,206,230,227,227,228},{234,234,234,234,234,234,234,234,233,236,235,232,234,235,235,236,237,237,219,206,198,194,190,184,183,179,176,173,169,166,164,161,158,156,153,150,147,144,142,140,137,136,134,132,131,130,128,127,128,129,130,132,134,135,138,144,153,163,178,206,230,228,229,229},{234,234,234,234,234,233,233,233,232,234,232,232,236,235,232,233,236,229,192,193,201,196,187,185,183,179,176,173,169,167,164,161,159,156,153,149,146,143,140,138,137,135,133,132,130,129,128,127,128,128,129,132,135,136,139,144,153,164,178,206,231,229,230,230},{233,233,233,233,233,233,233,233,233,234,233,234,235,232,231,233,236,213,174,189,202,195,188,187,183,179,176,173,169,167,165,161,159,156,152,149,146,143,140,138,136,135,133,131,129,128,128,127,127,128,129,131,134,135,139,145,153,164,178,205,230,230,231,231},{230,230,231,231,232,233,233,233,232,232,233,234,232,231,233,236,238,196,166,187,198,194,193,184,183,178,175,172,169,167,164,161,158,155,152,148,146,143,140,138,134,133,131,130,128,128,127,127,126,127,128,130,133,134,138,145,153,164,178,205,230,230,230,230},{229,229,229,230,230,231,231,232,230,230,232,231,230,233,234,230,215,175,161,180,196,194,192,183,183,178,175,172,168,166,163,159,157,154,150,146,144,140,137,134,131,131,130,128,127,126,126,126,126,127,127,129,131,133,138,144,153,163,178,204,230,230,230,229},{229,229,229,229,229,229,229,229,231,229,230,229,229,234,231,217,175,156,159,175,197,193,188,186,183,178,174,171,168,165,162,158,157,153,149,144,141,137,133,130,129,129,129,128,127,126,125,125,126,126,127,128,130,132,137,144,152,163,178,204,230,229,229,228},{228,228,227,228,230,229,228,230,232,229,227,230,233,225,197,166,161,167,174,178,190,195,184,186,182,176,173,171,168,165,162,159,156,152,146,140,133,129,127,124,123,123,124,126,127,125,124,124,125,126,126,128,130,132,136,143,152,162,177,202,230,230,227,229},{226,227,228,227,226,229,229,226,225,229,233,225,199,175,167,168,175,190,196,183,183,193,188,186,182,177,173,171,167,164,162,159,154,148,141,135,129,126,124,122,120,119,118,120,123,124,123,123,124,125,125,127,129,131,136,143,151,162,176,201,228,229,227,228},{225,227,226,226,228,224,224,232,233,226,205,176,162,171,184,188,208,224,223,195,183,191,190,184,182,177,173,170,166,164,162,159,154,145,137,133,129,126,124,121,118,116,114,114,118,121,122,121,123,124,124,126,129,130,135,141,151,161,176,200,227,228,226,227},{224,225,225,225,225,224,226,229,210,182,165,172,184,191,204,220,226,231,227,200,185,188,189,185,182,177,173,170,165,163,161,158,153,143,135,132,129,126,123,121,119,117,113,112,114,118,120,120,121,122,122,124,127,129,134,140,150,161,176,200,227,227,225,226},{223,222,225,223,220,228,221,193,167,170,177,190,205,218,225,228,226,225,220,199,188,186,189,186,182,177,173,169,165,162,160,156,148,139,131,129,127,124,121,119,118,117,114,112,112,115,118,120,120,121,121,123,126,128,132,139,148,160,176,199,226,227,225,225},{222,224,221,223,228,216,183,158,163,185,206,218,225,228,226,222,225,225,221,200,190,185,189,185,181,177,172,168,164,162,159,154,144,136,131,129,126,123,120,117,115,114,113,112,110,111,115,119,118,120,121,123,125,127,131,138,147,160,175,198,224,226,224,224},{221,224,220,223,219,182,154,164,192,209,223,224,222,221,222,224,221,224,219,198,190,184,187,184,181,176,172,168,164,162,158,151,140,136,132,129,125,123,120,117,114,112,111,111,109,108,111,117,117,119,121,123,125,126,131,138,147,159,174,196,222,224,223,223},{221,218,224,221,187,152,160,191,219,223,224,222,222,223,222,223,224,224,218,198,192,182,185,183,180,176,171,167,164,162,157,150,138,135,132,128,123,121,120,117,116,112,110,110,109,106,109,115,116,119,121,123,124,125,130,138,146,158,173,194,220,223,222,223},{219,217,223,208,158,148,188,217,220,219,219,218,219,220,221,222,221,222,215,198,192,181,186,183,179,175,171,167,164,162,156,146,138,134,131,127,124,122,120,117,113,110,108,110,108,106,107,112,116,118,119,120,124,126,130,137,147,159,173,195,220,222,221,222},{217,220,219,177,144,175,214,222,218,218,218,218,219,219,220,221,221,221,217,197,192,184,184,183,180,176,171,167,163,160,153,143,137,133,130,127,123,121,119,115,113,110,108,109,108,105,106,109,114,117,117,119,123,125,130,137,146,158,173,194,219,221,220,221},{215,216,212,161,151,202,223,218,217,217,218,218,218,219,219,219,220,219,217,196,191,185,180,182,178,174,170,166,163,159,151,141,136,132,128,125,122,119,117,113,112,110,108,107,106,105,104,105,112,116,116,117,121,124,129,137,145,158,172,193,218,219,218,218},{218,216,200,154,167,214,218,216,215,216,217,217,218,218,217,217,221,217,210,197,194,184,180,184,177,173,169,166,164,158,149,140,134,130,127,125,121,118,115,112,111,109,107,105,105,104,104,102,110,114,116,117,120,123,128,136,145,157,172,193,218,218,216,217},{214,217,189,149,183,220,214,215,215,215,216,216,216,216,216,216,218,207,190,191,194,181,180,182,178,175,170,166,163,156,145,137,134,130,127,124,120,117,114,111,110,109,106,104,103,104,103,101,107,113,115,116,120,122,127,134,145,157,171,193,217,218,216,216},{210,213,184,153,193,220,211,213,214,214,214,214,214,215,215,215,214,192,170,184,194,180,180,179,176,174,169,165,162,154,144,137,133,129,126,123,119,116,114,110,109,107,105,103,102,102,102,101,104,111,114,115,118,121,125,132,143,155,170,191,216,217,216,216},{214,208,188,159,187,213,212,213,212,212,213,213,213,213,213,213,213,184,166,185,195,184,181,181,174,172,168,163,160,152,143,139,133,129,125,122,117,115,113,109,108,106,104,103,102,101,100,99,101,109,112,113,116,120,124,131,141,153,167,189,214,216,215,216},{210,206,201,164,177,211,216,209,211,211,212,212,212,212,212,211,209,178,167,185,191,181,176,181,175,173,168,163,158,150,141,137,133,128,124,121,117,114,112,109,107,105,103,103,102,99,98,98,99,107,111,111,115,119,124,131,140,151,166,187,213,214,214,215},{210,205,207,183,167,197,219,206,212,209,209,212,211,208,210,216,204,169,159,180,192,183,177,182,176,170,165,162,159,151,142,135,131,126,123,121,117,113,110,106,106,104,102,101,100,98,97,97,98,103,109,112,114,117,124,130,139,150,165,185,210,213,211,213},{207,208,206,203,182,173,200,216,206,209,210,208,208,211,210,207,187,159,154,182,195,183,174,179,173,167,162,159,156,150,141,136,133,128,123,120,116,114,113,111,107,105,104,103,101,100,101,103,103,107,111,111,112,117,124,129,140,150,165,184,208,211,209,211},{205,201,205,214,209,186,177,194,209,211,210,208,211,213,203,188,163,167,176,184,184,177,175,180,171,168,165,164,161,155,147,142,134,130,127,124,120,116,114,111,108,108,108,106,104,101,100,101,108,112,114,114,114,119,124,127,138,149,164,183,207,210,208,211},{206,203,204,209,222,217,189,179,184,189,195,195,192,187,181,177,189,203,203,189,181,181,179,176,173,171,168,165,161,157,151,148,146,142,140,138,134,132,131,129,129,127,124,123,121,119,120,121,115,116,117,117,117,120,124,127,137,148,164,182,206,209,207,209},{199,206,201,202,212,224,230,218,202,198,194,191,193,198,208,215,213,213,203,191,185,179,175,178,173,171,168,166,165,164,163,163,160,158,158,158,155,152,149,146,145,144,143,143,141,138,135,133,134,131,128,126,125,125,128,132,139,149,163,181,205,208,204,206},{204,202,203,204,201,208,225,233,238,234,230,229,232,233,226,217,207,207,202,197,189,177,173,181,178,177,176,174,174,176,176,176,186,184,185,186,186,185,184,182,181,178,176,173,168,162,156,153,146,146,147,147,146,142,140,139,143,151,163,180,204,207,204,205},{204,195,202,202,201,203,203,214,220,225,228,227,224,219,211,203,203,205,201,195,188,181,177,178,187,194,203,208,208,202,192,184,162,153,143,136,129,127,126,125,129,130,133,139,148,160,172,180,184,183,177,168,161,158,155,152,154,159,167,180,203,206,204,205},{199,205,199,198,201,200,200,199,203,204,205,206,204,201,201,202,204,204,200,195,191,192,198,207,214,196,165,128,95,70,53,44,40,35,33,33,34,35,36,35,36,37,39,41,45,51,60,68,83,105,133,155,172,182,179,171,167,170,173,182,203,205,202,203},{198,199,199,199,199,199,200,201,200,200,200,200,200,201,201,202,203,202,199,197,204,214,206,160,96,54,31,26,28,33,31,34,36,33,39,38,40,43,46,44,44,48,45,54,54,48,53,62,55,60,46,53,73,107,163,191,193,183,179,188,201,205,204,203},{197,198,198,198,198,198,199,200,200,199,199,200,200,200,201,201,202,199,198,214,209,175,132,114,78,58,51,43,32,29,32,39,49,73,63,54,80,91,76,70,45,33,48,76,71,55,61,70,62,96,111,119,133,140,154,174,188,198,204,199,199,203,202,204},{196,196,196,197,197,198,199,199,198,198,199,199,199,200,200,201,198,201,220,205,163,141,132,128,120,102,94,87,82,83,78,74,71,93,74,70,91,102,90,89,76,83,74,93,97,125,119,131,129,148,154,151,171,181,171,179,170,180,203,210,202,200,201,202},{195,195,196,196,196,197,198,198,197,197,198,198,198,199,199,200,200,207,219,171,157,149,141,130,121,116,110,101,110,138,151,147,143,117,113,142,123,119,140,155,148,151,129,134,132,163,148,158,153,162,172,169,176,184,173,169,176,176,185,204,208,200,201,204},{196,195,195,195,196,196,197,197,196,196,197,197,197,198,198,198,193,210,221,167,157,152,142,136,132,117,112,114,112,112,123,139,144,149,145,162,152,149,158,172,161,171,160,149,171,171,159,186,166,170,175,170,163,166,171,173,179,187,184,205,221,204,197,196},{196,195,195,195,195,196,196,196,195,196,196,196,197,197,197,197,199,199,218,197,158,151,146,141,129,122,118,115,113,112,110,107,111,116,123,142,143,148,153,155,145,152,164,157,160,160,157,162,160,162,159,162,167,168,173,177,181,185,189,213,214,197,201,199},{195,194,194,194,195,196,196,196,195,195,196,196,196,196,195,195,195,193,209,221,193,162,139,138,132,125,119,118,117,117,117,116,117,121,118,115,119,128,130,127,129,133,133,138,139,148,147,159,159,162,164,170,176,172,169,174,187,190,206,220,206,194,200,196},{194,193,193,194,195,196,196,196,195,195,195,195,195,195,195,194,196,197,193,198,218,210,179,152,136,130,124,122,120,120,121,122,122,120,127,127,126,127,131,130,132,136,143,142,146,156,161,159,165,163,168,171,171,173,175,183,197,216,218,199,194,197,194,198},{193,192,192,192,193,193,194,194,194,194,194,196,196,195,194,195,195,195,195,195,198,203,208,211,188,169,148,134,128,125,123,123,124,126,128,129,130,132,135,137,137,140,143,145,149,156,161,163,166,167,170,175,183,194,206,213,216,205,195,192,194,196,196,196},{193,193,192,192,193,194,194,194,194,194,194,195,196,195,194,195,194,195,195,195,196,197,198,199,211,207,203,199,188,173,158,150,141,140,138,137,136,137,139,140,143,146,149,151,157,166,173,176,185,193,205,214,216,213,207,203,196,194,193,194,195,196,196,196},{193,193,193,193,194,195,195,195,194,193,194,195,195,195,195,195,193,194,194,195,195,195,194,194,192,194,198,203,206,207,209,212,208,205,200,197,194,193,191,190,192,195,198,201,205,210,214,215,215,213,209,203,197,194,192,192,192,194,195,194,193,193,193,193},{193,193,193,193,194,195,195,195,194,194,194,194,194,194,195,195,194,193,193,195,196,196,195,196,195,194,194,195,196,196,195,196,200,199,200,202,205,207,208,207,206,207,207,204,202,200,198,195,194,194,194,194,193,194,194,195,194,195,194,193,193,194,194,192},{193,193,193,193,194,195,195,194,195,195,195,194,194,194,194,194,194,193,193,195,195,195,194,195,198,195,193,193,195,195,195,195,194,194,195,196,196,195,194,193,195,195,195,194,194,194,194,194,195,195,195,195,194,194,193,193,193,193,193,192,193,195,194,191},{193,193,193,194,194,195,194,194,195,196,196,195,195,195,194,194,194,193,194,197,197,196,195,195,194,195,196,197,197,196,195,194,193,194,195,195,194,194,194,195,192,193,194,194,194,194,195,195,192,193,194,194,194,194,194,193,194,194,194,193,193,193,193,192},{194,194,194,194,195,195,194,194,195,196,196,195,195,196,195,194,194,194,195,198,198,196,196,197,196,195,194,193,193,195,196,197,198,198,197,197,195,195,195,195,195,196,197,197,196,195,194,193,194,194,194,195,195,195,195,195,194,193,193,193,193,193,195,197},{195,195,195,195,195,195,194,194,194,196,196,196,196,196,196,194,196,195,195,197,196,194,194,196,197,196,196,196,197,198,197,195,195,195,195,196,196,196,196,195,196,196,195,195,194,194,195,196,195,195,195,195,195,195,195,195,194,192,191,193,194,193,193,193}};

width= Dimensions[ cup][[1]];

2) alternatively import an image file

(* cup=Import[Experimental`FileBrowse[False]];
 cup =  cup/.Graphics->List;
 cup =  cup[[1,1]];
width = Dimensions[ cup][[1]];*)

Outline

Last time

Efficient coding

Task neutral 	
	1rs order statistics
		- point-wise non-linearities, histogram equalization, receptors and information capacity
	2nd order statistics
		- lateral inhibition, ganglion cells and predictive coding
		--opponent color processing (principal components analysis)
		--cortical representation
			Decorrelation, PCA
	3rd or higher orders?
		contrast normalization

Today: Continue with discussion of the two views of the function of early local visual spatial coding

Spatial (difference) filtering as efficient coding or as part of a system of edge detectors (or both?)

Local image measurements that correlate well with useful surface properties

task specific--find "significant" intensity changes
	edge detection
		1rst and 2nd spatial derivatives (i.e. the edge and bar detectors)
		relation to center-surround and oriented receptive fields

Problems with edge detection

Edge Detection

Introduction

new =  cup;
new[[width/2,All]]=0;
GraphicsRow[{ArrayPlot[new,Mesh->False],
ListPlot[ cup[[width/2]],PlotJoined->True,PlotRange->{50,250},ImageSize->Small]}]

Edge detection as differentiation

The Noise/Scale trade-off

The definition of edge detection is very tricky--exactly what do we want to detect? We would like to label "significant" intensity changes in the image. One definition of significant edges is that they are the ones with the biggest change in intensity. The biggest would correspond to step changes. In Mathematica, these can be modeled as g(x) = UnitStep[]. One of the first problems we encounter is that edges in an image are typically fuzzy, either due to optical blur in the imaging device, or because the  scene causes of edges are not changing abruptly. Our generative model for image data f is to convolve the step with a blur function:
f(x) = ∫g(x-x')blur(x')dx' = g*blur
where g() is the signal to be detected or estimated. g(x) is a step function:

g[x_]:= UnitStep[x-1];
Plot[g[x],{x,-2,2},PlotStyle->{Thick,Hue[0.9]}]

Depending on the type of blur,  the image intensity profile f(x) will look more or less like:

edge[x_,s_] := 1/(1 + Exp[-x/s])
Plot[edge[x,.3],{x,-2,2},Ticks->None]

One way of locating the position of the edge in this image would be to take the first derivative of the intensity function, and then mark the edge location at the peak of the first derivative:

dedge[u_,s_]:=D[edge[x,t],x]/.x->u/.t->s
Plot[dedge[u,.3],{u,-2,2},Ticks->None]

Alternatively, we could take the second derivative, and look for zero-crossings to mark the edge location.

d2edge[u_,s_] := D[dedge[x,t],x]/.x->u /.t->s
Plot[d2edge[u,.3],{u,-2,2},Ticks->None]

So far so good. But real images rarely have a nice smooth intensity gradation at points that we subjectively would identify as a clean edge. A more realistic generative model for intensity data would be:
	f(x) = ∫g(x-x')blur(x')dx' + noise
We'll add a fixed sample of high-frequency "noise":

noisyedge[x_,s_] := edge[x,s] + 
		0.01 Cos[10 x] + -0.02 Sin[10 x] + 0.03 Cos[12 x] + 0.04 Sin[12 x] +
		-0.01 Cos[13 x] + -0.03 Sin[13 x] + 0.01 Cos[14 x] + 0.01 Sin[14 x] +
		-0.04 Cos[25 x] + -0.02 Sin[25 x] + 0.02 Cos[26 x] + 0.03 Sin[26 x];
		
Plot[noisyedge[x,.3],{x,-2,2},Ticks->None]

Now, if we take the first derivative, there are all sorts of peaks, and the biggest isn't even where the edge is:

dnoisyedge[u_,s_] := D[noisyedge[x,t],x]/.x->u /.t->s
Plot[dnoisyedge[u1,.3],{u1,-2,2},Ticks->None]

Looking for zero-crossings looks even worse:

d2noisyedge[u_,s_] := D[dnoisyedge[x,t],x]/.x->u /.t->s
Plot[d2noisyedge[u1,.3],{u1,-2,2},Ticks->None]

There are many spurious zero-crossings.
In general, the higher the frequency of the noise, the bigger the problem gets. We can see what is going on by taking the nth derivative of the sinusoidal component with frequency parameter f. Here is the 3rd derivative of a component with frequency f:

D[Sin[x f],{x,3}]

The magnitude of the output is proportional to the frequency raised to the power of the derivative. Not good.

A solution: pre-blur using convolution

As in your Assignment #2, a possible solution to the noise problem is to pre-filter the image with a convolution operation that blurs out the fine detail which is presumably due to the noise. And then proceed with differentiation. The problem is how to choose the degree of blur. Blur the image too much, and one can miss edges; don't blur it enough, and one gets false edges. 
	This is one edge detection dilemma: Too much blur and we miss edges, too little and we have false alarms.

Some biologically motivated edge detection schemes

Edge detection using 2nd derivatives: Marr-Hildreth

Assignment 2 looked at one scheme for edge detection that has received some attention for its biological plausibility. This is the basis of the Marr-Hildreth edge detector. The idea is to: 1) pre-blur with a Gaussian; 2) take second derivates of the image intensity using the Laplacian ; 3) locate zero-crossings. In short,
	Find zero-crossings of: r(x,y) = ∫(∇^2)(Subscript[G, σ])(x',y')g(x-x',y-y')dx'dy' = ((∇^2)(Subscript[G, σ]))*g 
(∇^2)=((∂^2)/(∂(x^2)))+((∂^2)/(∂(y^2))) is the Laplacian operator, which takes the second derivatives in x and y directions, and sums up the result. 
As you saw in Assignment 2, the  Laplacian and  convolution operators are combined into the "del-squared G" operator, (∇^2)(Subscript[G, σ]), where
	 (Subscript[G, σ])[x,y] = ((e^((1/2) (-((x^2)/σ)-((y^2)/σ))))/(2 π σ))

Σ = {{σ,0},{0,σ}}; μ = {0,0};
ndist=MultinormalDistribution[μ ,Σ ];
PDF[ndist,{x,y}]

The order of the operators doesn't matter, so one can take the Laplacian of the Gaussian first, and then convolve this del-squared G kernel with the image, or one can blur the image first, and then take the second derivatives:
	r(x,y) = (∇^2)((Subscript[G, σ])*g)

The operators are said to "commute". 
As σ approaches zero, (Subscript[G, σ])becomes a delta function, and the (∇^2)(Subscript[G, σ]) becomes a Laplacian (∇^2),  i.e. a second derivative operator. For small σ, the detector is sensitive to noise. For large σ, it is less sensitive to noise, but misses edges. The biological appeal of the Marr-Hildreth detector is that lateral inhibitory filters provide the  ((∇^2)(Subscript[G, σ])) kernel.

One could   build zero-crossing detectors by ANDing the outputs of appropriately aligned center-surround filters effectively building oriented filters out of symmetric ganglion-cell (or LGN) like spatial filters (Marr and Hildreth).

But what about the oriented filters in the cortex? One interpretation consistent with the Hubel-Wiesel edge detector interpretation of sine-phase receptive fields in V1, is in terms of 1rst derivatives.

Edge detection using 1rst derivatives

Because of the orientation selectivity of cortical cells, they have sometimes been   interpreted as edge detectors. We noted earlier how a sine-phase Gabor function filter (1 cycle wide) would respond well to an edge oriented with its receptive field.

swidth=32;
sgabor[x_,y_, fx_, fy_,sig_] := 
	N[Exp[(-x^2 - y^2)/(2 sig*sig)] Sin[
		2 Pi (fx x + fy y)]];
edgefilter = Table[sgabor[i/32,j/32,0,2/3,1/2],
	{i,-swidth,swidth-1},{j,-swidth,swidth-1}];
	ArrayPlot[edgefilter,Mesh->False,Frame->False,PlotRange->{-1,1}]

As the width of the gaussin envelope decreases, these sine-phase or odd-symmetric filters can also be viewed as 1rst order spatial derivatives.

How can we combine oriented filters to signal an edge? The first-derivative operation takes the gradient of the image. From calculus, you learned that the gradient of a 2D function evaluated at (x,y) is a vector that points in the direction of maximum change. So taking the gradient of an image should produce a vector field where the vectors are perpendicular to the edges.The length of the gradient is a measure of the steepness of the intensity gradient.

The gradient of a function

∇g=(((∂g(x,y))/(∂x)) ,((∂g(x,y))/(∂y)))

Let's try it with the cup image.

contcup = ListInterpolation[Transpose[cup],{{1,width},{1,width}}];

DensityPlot[contcup[x,y],{x,1,64},{y,1,64},Mesh->False,PlotPoints->128]

Here's the derivative with respect to x:

DensityPlot[Evaluate[D[contcup[x,y],x]],{x,1,width},{y,1,width},PlotPoints->width/2,Mesh->False,Frame->False,PlotRange->{-100,100}]

Let's take the derivatives in the x and y directions:

fxcontcup[x_,y_]:=D[contcup[x1,y1],x1]  /.{ x1->x, y1->y};
fycontcup[x_,y_]:=D[contcup[x1,y1],y1]  /.{ x1->x, y1->y};

Now let's put the x and y directions together and compute the squared gradient magnitude:

fcontcup[x_,y_]:=D[contcup[x1,y1],x1]^2+D[contcup[x1,y1],y1]^2  /.{ x1->x, y1->y};

gradientedge=Table[N[fcontcup[x,y]],{x,1,width},{y,1,width}];

The range of gradientedge is large, so we'll plot the Log to squeeze it down:

ArrayPlot[Log[Transpose[gradientedge]+.0001]]

Doesn't look too bad, but it isn't clean and some of our satisfaction is premature and the result of our visual system effectively fitting the edge representation above into the interpretation of a cup. Further, we haven't specified a blur level, or a criterion for the threshold. We haven't put a measure of confidence on the edges.

Manipulate[ArrayPlot[Sign[t-Transpose[gradientedge]]],{t,0,Max[gradientedge]}]

There is also useful information in the direction of the gradient vectors:

(*VectorFieldPlot[{fxcontcup[x,y],fycontcup[x,y]},{x,1,width},{y,1,width}]*)

GradientFieldPlot[contcup[x1,y1],{x1,1,width},{y1,1,width},ImageSize->Small]

Imagine trying to link up points along an edge with this information---You get a better idea of how much variability remains in terms of both direction and magnitude. 
If we took many pictures of the same cup under different illumination conditions, one could measure how much variability (at a point) is  in the magnitude vs. diretion of the gradient. Chen et al. (2000) did this and showed that there is much more variability in the magnitude than the direction of the gradient.

Summing up: Combining a smoothing pre-blur with 1rst derivatives

As with the 2nd derivative zero-crossing detector, the idea is to blur the image, and then take the first derivates in the x and y directions, square each and add them up, the 1rst derivative analog to the 2nd derivative (∇^2)G operator.
The x and y components of the gradient of the blur kernel :

G[x_,y_,σx_,σy_]:=((E^((1/2) (-((x^2)/(σx))-((y^2)/(σy)))))/(2 π Sqrt[(σx^2+σy^2)]));
dGx[x_,y_]:=D[G[x1,y1,1,2],x1]/.{x1->x,y1->y};
xg=DensityPlot[-dGx[x,y],{x,-2,2},{y,-2,2},Mesh->False,Frame->False,PlotPoints->64];
dGx[x_,y_]:=D[G[x1,y1,2,1],y1]/.{x1->x,y1->y};
yg=DensityPlot[-dGx[x,y],{x,-2,2},{y,-2,2},Mesh->False,Frame->False,PlotPoints->64];
GraphicsRow[{xg,yg}]

--2D smoothing operator followed by a first order directional derivatives in the x and y directions.

If one takes the outputs of two such cells, one vertical and one horizontal, the sum of the squares of their outputs correspond to the squared magnitude of the gradient of the smoothed image:

((Subscript[r, x])(x,y), (Subscript[r, y])(x,y)) = (((∂(Subscript[G, σ])(x,y))/(∂x)) , ((∂(Subscript[G, σ])(x,y))/(∂y)))*g(x,y) = ∇(Subscript[G, σ])*g(x,y) = (((∂(Subscript[G, σ])(x,y))/(∂x))*g(x,y) , ((∂(Subscript[G, σ])(x,y))/(∂y))*g(x,y))
 Then to get a measure of strength, compute the squared length: 
		|∇(Subscript[G, σ])*g(x,y)((|)^2) = |∇((Subscript[G, σ])*g(x,y))((|)^2) = (Subscript[r, x])(x,y)2+ (Subscript[r, y])(x,y)2
We'll encounter this idea later when we extend detecting edges in space to detecting edges in space-time in order to make motion measurements.

Morrone & Burr edge detector--combining even and odd filters

The Marr-Hildreth 2nd derivative operation is similar to the even-symmetric cosine-phase gabor or "bar detector". The 1rst derivative gradient operator is similar to the odd-symmetric sine-phase gabor. Any reason to combine them?

Sometimes the important "edge" is actually a line--i.e. a pair of edges close together. A line-drawing is an example.
The Appendix below shows how one can combine both sine and cosine phase filters to detect both edges and lines. A sine and cosine phase pair are sometimes called "quadrature (phase) pairs". The summed squared outputs can be interpreted as "local contrast energy".
Quadrature pairs will also crop up later in the context of motion detection.

Problems with interpreting V1 simple/complex cells as edge detectors

Although one can build edge  detectors from oriented filters, simple cells cannot uniquely signal the  presence of an edge for several reasons. One is that their response is a  function of many different parameters. A low contrast bar at an optimal  orientation will produce the same response as a bar of higher contrast at a  non-optimal orientation.  There is a similar trade-off with other parameters  such as spatial frequency and temporal frequency. In order to make explicit the location of an edge from the responses of a population of cells, one would have to compute something like the "center-of-mass" over the population, where response rate takes the place of mass. Another problem is that edge detection has to take into account a range of spatial scales.  We discussed evidence earlier that the cortical basis set does encompass a range of spatial scales, and in fact may be "self-similar" across these scales. See Koenderink (1990) for a  theoretical discussion of "ideal" receptive field properties from the point of view of basis elements. One way of combining information efficiently across scales is to use a Laplacian image pyramid (See supplementary links on class web page). Oriented information can be computed across scales using a steerable pyramid.
Konishi et al. (2003) used signal detection theory and real images to show that there is an advantage in combining information across scales when doing edge detection.

Segmentation & Why edge detection is hard

The same intensity gradient means different things depending on context

Land & McCann's "Two squares and a happening"

size = 256;Clear[y]; slope = 0.0005;
y[x_] := slope x +0.5 /;x<1*size/2
y[x_] := slope (x-128) +0.5  /; x>=1*size/2

picture = Table[Table[y[i],{i,1,size}],{i,1,size}];
ArrayPlot[picture,Frame->False,Mesh->False, 
				PlotRange->{0,1}, AspectRatio->Automatic]

The left half looks lighter than the right half. But, let's plot the intensity across a horizontal line:

new =  picture;
new[[128,All]]=0;
GraphicsRow[{ArrayPlot[new,PlotRange->{0,1}],
g0=ListPlot[ picture[[128]],PlotJoined->True,PlotRange->{0.2,.8}]}]

The two ramps are identical...tho' not too surprising in that that is how we constructed the picture. How can we explain this illusion based on what we've learned so far?

One explanation is that the visual system takes a spatial derivative of the intensity profile. Recall from calculus that the  second derivative of a linear function is zero. So a second derivative should filter out the slowly changing linear ramp in the illusory image. We approximate the second derivative with a discrete kernel (-1,2,-1). 
The steps are: 1) take the second derivative of the image; 2) threshold out

filter = {-1,2,-1};

(*Take the second derivative at each location*)
fspicture = ListConvolve[filter, picture[[128]]]; 
g1=ListPlot[fspicture,PlotJoined->True, PlotRange->{-0.1,.1},Axes->False];

(*Now integrate twice--to undo the the second derivative and "restore" the picture*)
integratefspicture = FoldList[Plus,fspicture[[1]],fspicture];
integratefspicture2 = FoldList[Plus,integratefspicture[[1]],integratefspicture];

g2=ListPlot[integratefspicture2,PlotJoined->True,Axes->False];
GraphicsRow[{g0,g1,g2},ImageSize->Large]

To handle gradients that aren't perfectly linear, we could add a threshold function to set small values to zero before re-integrating:

threshold[x_,τ_]:= If[x>τ, x,0];SetAttributes[threshold,Listable];
fspicture = threshold[fspicture,0.025];

Or one can take just the first derivative, followed by the threshold function

"Two cylinders and no happening"

But is edge enhancement and and spatial filtering a good way to explain the lightness effect? Up until the early 1990's many people thought so, and this was a standard textbook explanation of these kinds of lightness illusions.
What if we measure the intensity across a horizontal line in the "slab" on the left, and the "two-cylinders" on the right?

They are also the same! They would both look something like this:

But the perceived lightness contrast for the slabs is significantly stronger than it is for the two cylinders. A spatial convolution/derivative model would predict the same for both. The spatial convolution operation won't work as an explanation!
One interpretation of this observation is that the visual system has knowledge of the type of edge--i.e. whether it is due to pigment or to self-occlusion/contact. (See Knill and Kersten, 1991).

Edge classification: Some causes of edges are more important than others: task-dependence

We’ve seen that uncertainty due to noise and spatial scale confound reliable edge detection. But the above demonstrates another reason why edge detection is hard--local intensity gradients can have several possible meanings. Even when there is little or no noise, local measurements of contrast change say very little about the physical cause of the gradient. And a "smart" visual system takes the causes into account.

So on the one hand, it still makes sense to interpret lateral inhibitory filters and oriented cortical filters as possible components of an edge detection system, but we have to allow for considerable uncertainty in the significance of their outputs--i.e. a local edge detector typically has a low signal-to-noise ratio for a variety of ways of defining signals, e.g., whether the causes are geometric or photometric.

For tasks such as object recognition, vision places a higher utility on surface and material edges than on other types. Surface edges are used differently from material edges. Shadow edges are variable yet potentially important for stereo. Specular edges are variable, but problematic for stereo because they are at different surface positions for the two eyes.

The well-known dalmation dog illusion illustrates the high-level knowledge the human visual system brings to bear on the problem of segmenting an object.

Combining signal detection theory with edge detection

Canny (1986).

Possible project idea: Build a Bayesian edge detector using gradient statistics measured on and off of real edges, and using methods from signal detection theory to decide theory to decide whether a given measurement is on or off of an edge.

The left panel of the figure below shows "range data", where geometric depth from the camera is represented by graylevel, with dark meaning close, and light meaning far. The right panel shows intensity data. The data in the left can be used to define measures of "geometric ground truth", and one can devise edge detectors based on a signal detection theory analysis of how well the intensity changes on the right predicts geometrical changes on the left. In other words, what edge detector provides the best ROC performance? (See Konishi et al., 2003).

Natural images & segmentation

Lonesome peak

Where to draw the important contours?

To translate edge detection into useful segmentations is a non-trivial computer vision problem. For state-of-the-art work on this, see Malik et al. (2001) and Tu and Zhu (2002), and a preprint: http://www.stat.ucla.edu/~sczhu/papers/IJCV_parsing.pdf

Early spatial filtering seems more appealing as efficient encoding.

Next time

Mid-term exam

Next lecture

Image-based modeling: geometry, contours & long lines

Surfaces from images

Scene-based modeling

Appendices

The Hessian, "Interest operators", and saliency.

SetOptions[ArrayPlot,ColorFunction->"GrayTones",DataReversed->True,Frame->False,AspectRatio->Automatic,Mesh->False,PixelConstrained->True,ImageSize->Small];

The input 64x64 image: face

64x64 Array--don't open

face = {
{0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 0.6000, 0.6000, 0.5333, 0.4667, 
0.4667, 0.4000, 0.2667, 0.3333, 0.4000, 0.4667, 0.5333, 0.6000, 0.6667, 
0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 0.6000, 0.6667, 0.6000, 
0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 
0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 
0.5333, 0.4667, 0.4667, 0.5333, 0.4667, 0.4667, 0.4667, 0.4667, 0.4667, 
0.5333, 0.4667, 0.5333, 0.5333, 0.5333, 0.4667, 0.5333, 0.5333, 0.5333, 
0.5333},
{0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.5333, 0.6000, 0.5333, 0.4667, 
0.4000, 0.3333, 0.2667, 0.2667, 0.4000, 0.4667, 0.5333, 0.6000, 0.6000, 
0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 0.6000, 0.6000, 0.6000, 
0.6000, 0.6000, 0.6000, 0.5333, 0.5333, 0.6000, 0.6000, 0.5333, 0.6000, 
0.6000, 0.6000, 0.5333, 0.6000, 0.5333, 0.6000, 0.6000, 0.5333, 0.5333, 
0.4667, 0.4667, 0.4667, 0.4667, 0.4000, 0.4000, 0.4667, 0.4667, 0.5333, 
0.5333, 0.5333, 0.4667, 0.5333, 0.6000, 0.5333, 0.5333, 0.6000, 0.6000, 
0.6000},
{0.5333, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.5333, 0.4667, 
0.4000, 0.2667, 0.1333, 0.1333, 0.3333, 0.4667, 0.5333, 0.6000, 0.6000, 
0.6667, 0.6667, 0.6667, 0.6667, 0.6000, 0.6000, 0.5333, 0.4667, 0.5333, 
0.4667, 0.4667, 0.4667, 0.4667, 0.4667, 0.4667, 0.4667, 0.4667, 0.5333, 
0.5333, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.5333, 0.5333, 
0.4667, 0.4000, 0.4000, 0.4000, 0.3333, 0.4000, 0.4000, 0.4667, 0.4667, 
0.4667, 0.5333, 0.5333, 0.5333, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 
0.6000},
{0.5333, 0.5333, 0.5333, 0.6000, 0.6000, 0.6000, 0.5333, 0.4667, 0.4667, 
0.4000, 0.3333, 0.0667, 0.0667, 0.2667, 0.4000, 0.5333, 0.6000, 0.6000, 
0.6667, 0.6667, 0.6000, 0.6000, 0.5333, 0.5333, 0.5333, 0.5333, 0.5333, 
0.5333, 0.5333, 0.5333, 0.5333, 0.4667, 0.4667, 0.3333, 0.3333, 0.3333, 
0.4667, 0.5333, 0.5333, 0.5333, 0.6000, 0.6000, 0.5333, 0.4667, 0.4667, 
0.4667, 0.4000, 0.3333, 0.3333, 0.2667, 0.2667, 0.3333, 0.4000, 0.4000, 
0.4667, 0.5333, 0.6000, 0.6000, 0.6000, 0.6000, 0.6667, 0.6667, 0.6667, 
0.6667},
{0.4000, 0.4667, 0.4667, 0.5333, 0.5333, 0.5333, 0.5333, 0.5333, 0.4667, 
0.4000, 0.3333, 0.1333, 0.1333, 0.2667, 0.4000, 0.5333, 0.6000, 0.6000, 
0.6000, 0.6000, 0.6000, 0.5333, 0.5333, 0.5333, 0.6000, 0.6000, 0.6000, 
0.6667, 0.6667, 0.6667, 0.6000, 0.6000, 0.6000, 0.5333, 0.4000, 0.2667, 
0.2667, 0.4000, 0.4667, 0.5333, 0.5333, 0.5333, 0.4667, 0.5333, 0.4667, 
0.4000, 0.3333, 0.3333, 0.2667, 0.2000, 0.2667, 0.3333, 0.4000, 0.4667, 
0.4667, 0.5333, 0.5333, 0.6000, 0.6000, 0.6667, 0.6667, 0.6667, 0.6667, 
0.6667},
{0.4000, 0.3333, 0.3333, 0.4000, 0.4667, 0.4667, 0.4667, 0.4667, 0.4000, 
0.4000, 0.3333, 0.1333, 0.0667, 0.2667, 0.4000, 0.4667, 0.6000, 0.6000, 
0.5333, 0.5333, 0.5333, 0.5333, 0.6000, 0.6000, 0.6667, 0.6667, 0.6667, 
0.6667, 0.6667, 0.7333, 0.6667, 0.6667, 0.6000, 0.6000, 0.5333, 0.4667, 
0.2667, 0.2000, 0.2667, 0.4000, 0.4667, 0.4667, 0.4667, 0.5333, 0.4667, 
0.4000, 0.3333, 0.2667, 0.2000, 0.1333, 0.2000, 0.3333, 0.4000, 0.4667, 
0.5333, 0.5333, 0.6000, 0.6000, 0.6000, 0.6667, 0.6667, 0.6667, 0.6667, 
0.6667},
{0.6000, 0.4667, 0.4000, 0.3333, 0.3333, 0.3333, 0.4000, 0.4000, 0.4000, 
0.3333, 0.3333, 0.2000, 0.1333, 0.2667, 0.4000, 0.4667, 0.5333, 0.5333, 
0.4667, 0.4667, 0.4667, 0.5333, 0.6000, 0.6667, 0.6667, 0.7333, 0.7333, 
0.7333, 0.7333, 0.7333, 0.7333, 0.6667, 0.6667, 0.6000, 0.5333, 0.5333, 
0.4667, 0.3333, 0.2000, 0.2000, 0.2667, 0.4000, 0.4667, 0.4667, 0.4000, 
0.3333, 0.3333, 0.2000, 0.1333, 0.0667, 0.1333, 0.3333, 0.4667, 0.5333, 
0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.6667, 0.6667, 0.6667, 0.6667, 
0.6667},
{0.6000, 0.6000, 0.5333, 0.4000, 0.2000, 0.2000, 0.2667, 0.2667, 0.3333, 
0.3333, 0.3333, 0.2000, 0.1333, 0.3333, 0.4000, 0.4667, 0.4667, 0.4667, 
0.4000, 0.4667, 0.5333, 0.5333, 0.6000, 0.6667, 0.7333, 0.7333, 0.7333, 
0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.6667, 0.6000, 0.5333, 0.5333, 
0.4667, 0.4000, 0.3333, 0.2667, 0.2000, 0.2000, 0.2667, 0.4000, 0.4000, 
0.3333, 0.2667, 0.2000, 0.0667, 0.0000, 0.1333, 0.4000, 0.4667, 0.5333, 
0.6000, 0.6000, 0.6000, 0.6667, 0.6000, 0.6667, 0.6667, 0.6667, 0.6667, 
0.6000},
{0.5333, 0.6000, 0.6000, 0.4667, 0.3333, 0.3333, 0.2667, 0.2000, 0.2000, 
0.2667, 0.3333, 0.2667, 0.2000, 0.3333, 0.4000, 0.4667, 0.4000, 0.3333, 
0.4000, 0.4667, 0.5333, 0.6000, 0.6000, 0.6667, 0.7333, 0.7333, 0.7333, 
0.8000, 0.7333, 0.8000, 0.7333, 0.7333, 0.6667, 0.6000, 0.6000, 0.5333, 
0.5333, 0.4667, 0.4000, 0.3333, 0.2667, 0.2000, 0.2000, 0.2000, 0.3333, 
0.3333, 0.2667, 0.2000, 0.0667, 0.0000, 0.2000, 0.4000, 0.5333, 0.6000, 
0.6000, 0.6000, 0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 0.6000, 0.6000, 
0.6000},
{0.6000, 0.6667, 0.6667, 0.5333, 0.3333, 0.4667, 0.4667, 0.3333, 0.2667, 
0.2000, 0.2667, 0.2000, 0.2000, 0.3333, 0.3333, 0.4000, 0.4000, 0.4000, 
0.4667, 0.5333, 0.6000, 0.6000, 0.6000, 0.6667, 0.7333, 0.7333, 0.8000, 
0.8000, 0.8000, 0.8000, 0.7333, 0.7333, 0.7333, 0.6667, 0.6000, 0.6000, 
0.5333, 0.4667, 0.4667, 0.4000, 0.4000, 0.3333, 0.2667, 0.2000, 0.1333, 
0.2000, 0.2000, 0.2000, 0.0667, 0.0000, 0.1333, 0.4000, 0.5333, 0.6000, 
0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.6667, 0.6000, 0.6000, 0.6000, 
0.5333},
{0.6000, 0.6667, 0.6667, 0.5333, 0.4000, 0.4667, 0.5333, 0.5333, 0.4667, 
0.4000, 0.2667, 0.2000, 0.2000, 0.3333, 0.3333, 0.4000, 0.4667, 0.4667, 
0.4667, 0.5333, 0.6000, 0.6667, 0.6667, 0.7333, 0.7333, 0.8000, 0.8000, 
0.8000, 0.8000, 0.8000, 0.7333, 0.7333, 0.7333, 0.6667, 0.6667, 0.6000, 
0.6000, 0.5333, 0.4667, 0.4667, 0.4667, 0.4000, 0.4000, 0.2667, 0.2000, 
0.0667, 0.0667, 0.1333, 0.0667, 0.0000, 0.1333, 0.3333, 0.4667, 0.5333, 
0.5333, 0.5333, 0.6000, 0.6000, 0.6000, 0.6000, 0.5333, 0.5333, 0.5333, 
0.4667},
{0.6667, 0.6667, 0.6667, 0.6000, 0.3333, 0.4667, 0.5333, 0.5333, 0.6000, 
0.6000, 0.4000, 0.2667, 0.2000, 0.3333, 0.4000, 0.4667, 0.4667, 0.5333, 
0.5333, 0.6000, 0.6667, 0.6667, 0.7333, 0.7333, 0.7333, 0.8000, 0.8000, 
0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.6667, 0.7333, 0.6667, 0.6667, 
0.6000, 0.5333, 0.4667, 0.5333, 0.4667, 0.4667, 0.4667, 0.4000, 0.3333, 
0.2000, 0.0667, 0.0667, 0.0000, 0.0000, 0.0667, 0.2000, 0.4000, 0.4667, 
0.4667, 0.5333, 0.5333, 0.5333, 0.5333, 0.5333, 0.4667, 0.4667, 0.4000, 
0.4000},
{0.6667, 0.6667, 0.6667, 0.6000, 0.4000, 0.4667, 0.5333, 0.5333, 0.6000, 
0.6667, 0.5333, 0.3333, 0.3333, 0.4000, 0.4667, 0.5333, 0.5333, 0.5333, 
0.6000, 0.6000, 0.6667, 0.6667, 0.6667, 0.7333, 0.7333, 0.7333, 0.7333, 
0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.6667, 0.6667, 
0.6000, 0.5333, 0.5333, 0.5333, 0.5333, 0.5333, 0.4667, 0.4667, 0.4000, 
0.3333, 0.2000, 0.0667, 0.0000, 0.0000, 0.0000, 0.1333, 0.3333, 0.4000, 
0.4667, 0.4667, 0.4667, 0.4667, 0.4667, 0.4000, 0.4000, 0.3333, 0.3333, 
0.2667},
{0.6000, 0.6667, 0.6000, 0.5333, 0.4000, 0.4667, 0.5333, 0.5333, 0.6000, 
0.6000, 0.4667, 0.3333, 0.4000, 0.4667, 0.5333, 0.6000, 0.6000, 0.6000, 
0.5333, 0.6000, 0.6667, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 
0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.6667, 0.6667, 
0.6000, 0.6000, 0.6000, 0.5333, 0.5333, 0.5333, 0.5333, 0.4667, 0.4000, 
0.4000, 0.2667, 0.2667, 0.0667, 0.0000, 0.0000, 0.0667, 0.2000, 0.3333, 
0.3333, 0.3333, 0.3333, 0.3333, 0.3333, 0.2667, 0.2667, 0.2000, 0.1333, 
0.1333},
{0.5333, 0.6000, 0.6667, 0.6000, 0.4667, 0.4667, 0.5333, 0.5333, 0.5333, 
0.4667, 0.4000, 0.4000, 0.4667, 0.5333, 0.6000, 0.6000, 0.6000, 0.6000, 
0.6000, 0.6000, 0.5333, 0.4667, 0.4667, 0.4667, 0.4667, 0.4000, 0.4667, 
0.4667, 0.4000, 0.4000, 0.4000, 0.4000, 0.4000, 0.4000, 0.4667, 0.4667, 
0.5333, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.5333, 0.4667, 0.4000, 
0.4000, 0.3333, 0.3333, 0.2667, 0.0667, 0.0000, 0.0000, 0.0667, 0.2000, 
0.2000, 0.1333, 0.0667, 0.1333, 0.1333, 0.1333, 0.0667, 0.0667, 0.0000, 
0.0667},
{0.6000, 0.6667, 0.6667, 0.6000, 0.4667, 0.4667, 0.5333, 0.4667, 0.4000, 
0.3333, 0.4000, 0.4000, 0.4667, 0.5333, 0.5333, 0.6000, 0.6667, 0.6667, 
0.6000, 0.5333, 0.4667, 0.4000, 0.4000, 0.4000, 0.3333, 0.3333, 0.3333, 
0.4000, 0.3333, 0.3333, 0.3333, 0.2667, 0.2667, 0.2667, 0.3333, 0.3333, 
0.4667, 0.5333, 0.6000, 0.6667, 0.6667, 0.6000, 0.6000, 0.5333, 0.4667, 
0.4000, 0.3333, 0.3333, 0.2667, 0.2000, 0.0667, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0667, 0.2000, 0.0667, 0.0000, 0.0000, 
0.0667},
{0.6000, 0.6000, 0.6667, 0.6000, 0.4667, 0.4000, 0.5333, 0.4000, 0.3333, 
0.3333, 0.4000, 0.4667, 0.5333, 0.6000, 0.6000, 0.6667, 0.6667, 0.6667, 
0.6000, 0.5333, 0.4000, 0.3333, 0.3333, 0.2667, 0.2667, 0.3333, 0.4000, 
0.4667, 0.4667, 0.4667, 0.4000, 0.3333, 0.2667, 0.2667, 0.2000, 0.2000, 
0.3333, 0.4667, 0.6000, 0.6667, 0.6667, 0.6667, 0.6000, 0.5333, 0.4667, 
0.4000, 0.3333, 0.3333, 0.3333, 0.2000, 0.0667, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.2000, 0.4000, 0.2000, 0.0000, 0.0000, 
0.0667},
{0.6000, 0.6000, 0.6667, 0.6000, 0.4000, 0.3333, 0.5333, 0.3333, 0.2667, 
0.4000, 0.4667, 0.4667, 0.5333, 0.6000, 0.6000, 0.6667, 0.6667, 0.6667, 
0.6000, 0.4667, 0.2667, 0.2000, 0.2000, 0.2000, 0.2667, 0.3333, 0.3333, 
0.3333, 0.2667, 0.3333, 0.2667, 0.2667, 0.2000, 0.1333, 0.0667, 0.0667, 
0.1333, 0.2667, 0.4667, 0.6000, 0.6000, 0.6667, 0.6000, 0.4667, 0.4000, 
0.4000, 0.3333, 0.3333, 0.3333, 0.2667, 0.1333, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.1333, 0.4000, 0.2000, 0.0000, 0.0000, 
0.0000},
{0.6000, 0.6000, 0.6667, 0.6667, 0.4667, 0.3333, 0.4000, 0.2667, 0.3333, 
0.4000, 0.4667, 0.5333, 0.5333, 0.6000, 0.6000, 0.6667, 0.6667, 0.6667, 
0.6000, 0.4000, 0.2000, 0.1333, 0.2000, 0.2000, 0.2000, 0.2000, 0.2000, 
0.2000, 0.2000, 0.2000, 0.2000, 0.1333, 0.1333, 0.1333, 0.2000, 0.2000, 
0.2000, 0.2000, 0.3333, 0.4667, 0.5333, 0.5333, 0.5333, 0.4667, 0.4000, 
0.3333, 0.3333, 0.3333, 0.2667, 0.2667, 0.1333, 0.0667, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0667, 0.4000, 0.2667, 0.0000, 0.0000, 
0.0667},
{0.6000, 0.6000, 0.6667, 0.6667, 0.4667, 0.3333, 0.3333, 0.2667, 0.3333, 
0.4667, 0.5333, 0.5333, 0.5333, 0.6000, 0.6000, 0.6000, 0.4667, 0.5333, 
0.4667, 0.4000, 0.4000, 0.4000, 0.4000, 0.3333, 0.3333, 0.3333, 0.3333, 
0.4000, 0.4667, 0.4667, 0.4000, 0.3333, 0.4000, 0.4000, 0.4667, 0.4667, 
0.4000, 0.3333, 0.2667, 0.3333, 0.4000, 0.4667, 0.5333, 0.4667, 0.4000, 
0.4000, 0.3333, 0.3333, 0.3333, 0.2667, 0.2000, 0.0667, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.3333, 0.2667, 0.0000, 0.0000, 
0.0667},
{0.6000, 0.6000, 0.6667, 0.6000, 0.4667, 0.2667, 0.2667, 0.3333, 0.4000, 
0.4667, 0.5333, 0.4667, 0.5333, 0.6000, 0.6000, 0.5333, 0.5333, 0.4667, 
0.5333, 0.5333, 0.6000, 0.6000, 0.5333, 0.6000, 0.5333, 0.5333, 0.6000, 
0.6667, 0.6667, 0.6667, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.5333, 
0.5333, 0.4667, 0.4667, 0.4000, 0.4667, 0.5333, 0.5333, 0.4667, 0.4000, 
0.3333, 0.3333, 0.3333, 0.3333, 0.2667, 0.2000, 0.0667, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.2667, 0.2667, 0.0000, 0.0000, 
0.0667},
{0.6667, 0.6000, 0.6667, 0.6667, 0.5333, 0.2667, 0.2000, 0.3333, 0.4000, 
0.4667, 0.4667, 0.5333, 0.5333, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 
0.6000, 0.6000, 0.6000, 0.6000, 0.6667, 0.6667, 0.6667, 0.6667, 0.7333, 
0.7333, 0.7333, 0.7333, 0.7333, 0.6667, 0.6667, 0.6000, 0.5333, 0.6000, 
0.5333, 0.5333, 0.5333, 0.6000, 0.5333, 0.6000, 0.5333, 0.5333, 0.4667, 
0.4000, 0.4000, 0.3333, 0.3333, 0.2667, 0.1333, 0.0667, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.2000, 0.2667, 0.0000, 0.0000, 
0.0000},
{0.6667, 0.6000, 0.6667, 0.6667, 0.5333, 0.3333, 0.2667, 0.3333, 0.4000, 
0.4000, 0.4667, 0.5333, 0.5333, 0.6000, 0.6000, 0.6667, 0.6667, 0.6667, 
0.6667, 0.6667, 0.6000, 0.6667, 0.6667, 0.6667, 0.6667, 0.7333, 0.7333, 
0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.6667, 0.6667, 0.6000, 0.6000, 
0.6000, 0.6000, 0.6000, 0.6667, 0.6000, 0.6000, 0.6000, 0.5333, 0.5333, 
0.4667, 0.4000, 0.4000, 0.3333, 0.2667, 0.1333, 0.0667, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0667, 0.1333, 0.0000, 0.0000, 
0.0000},
{0.6667, 0.6667, 0.6667, 0.6667, 0.5333, 0.3333, 0.2667, 0.2667, 0.3333, 
0.4000, 0.4667, 0.5333, 0.5333, 0.6000, 0.6000, 0.6667, 0.6667, 0.6667, 
0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 0.7333, 
0.7333, 0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 0.6000, 
0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 0.6000, 0.5333, 0.5333, 
0.4667, 0.4667, 0.4000, 0.3333, 0.2667, 0.1333, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000},
{0.6667, 0.6667, 0.6667, 0.6667, 0.5333, 0.4000, 0.2000, 0.2667, 0.3333, 
0.4000, 0.4667, 0.5333, 0.6000, 0.5333, 0.6000, 0.6667, 0.6667, 0.7333, 
0.7333, 0.7333, 0.7333, 0.6667, 0.6667, 0.6000, 0.6000, 0.6000, 0.6667, 
0.6000, 0.5333, 0.6000, 0.6000, 0.6667, 0.6667, 0.6000, 0.6000, 0.6667, 
0.6667, 0.6667, 0.7333, 0.7333, 0.6667, 0.6667, 0.6000, 0.6000, 0.5333, 
0.4667, 0.4667, 0.4000, 0.4000, 0.2667, 0.2000, 0.0667, 0.0000, 0.0000, 
0.0000, 0.0667, 0.1333, 0.1333, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000},
{0.6667, 0.6667, 0.6667, 0.6000, 0.4667, 0.3333, 0.2000, 0.2000, 0.3333, 
0.4667, 0.4667, 0.5333, 0.6000, 0.6000, 0.6000, 0.6667, 0.6667, 0.7333, 
0.7333, 0.7333, 0.7333, 0.7333, 0.6667, 0.5333, 0.5333, 0.6000, 0.6000, 
0.5333, 0.4667, 0.5333, 0.5333, 0.5333, 0.6000, 0.6000, 0.5333, 0.6000, 
0.6667, 0.7333, 0.7333, 0.7333, 0.7333, 0.6667, 0.6667, 0.6000, 0.5333, 
0.5333, 0.4000, 0.4000, 0.4000, 0.2667, 0.2000, 0.0667, 0.0000, 0.0000, 
0.0667, 0.2667, 0.4000, 0.4000, 0.2667, 0.0667, 0.0000, 0.0000, 0.0000, 
0.0000},
{0.6667, 0.6000, 0.6000, 0.6000, 0.4667, 0.3333, 0.2000, 0.2000, 0.3333, 
0.4667, 0.5333, 0.6000, 0.5333, 0.6000, 0.6667, 0.6667, 0.7333, 0.7333, 
0.8000, 0.8000, 0.7333, 0.6667, 0.6000, 0.5333, 0.5333, 0.5333, 0.5333, 
0.5333, 0.5333, 0.5333, 0.4667, 0.4667, 0.4667, 0.5333, 0.4667, 0.4667, 
0.6000, 0.7333, 0.7333, 0.7333, 0.6667, 0.6667, 0.6000, 0.6000, 0.5333, 
0.5333, 0.4667, 0.4000, 0.4000, 0.2667, 0.2000, 0.0667, 0.0000, 0.0000, 
0.0667, 0.2667, 0.4667, 0.4667, 0.4000, 0.3333, 0.0667, 0.0000, 0.0000, 
0.0000},
{0.5333, 0.5333, 0.5333, 0.6000, 0.5333, 0.4000, 0.2000, 0.2667, 0.4000, 
0.4667, 0.5333, 0.6000, 0.5333, 0.6000, 0.6667, 0.6667, 0.6667, 0.7333, 
0.7333, 0.8000, 0.7333, 0.6667, 0.5333, 0.5333, 0.6000, 0.5333, 0.5333, 
0.6000, 0.6667, 0.6667, 0.6000, 0.4667, 0.4667, 0.5333, 0.4667, 0.4000, 
0.6000, 0.7333, 0.7333, 0.7333, 0.6667, 0.6667, 0.6000, 0.5333, 0.5333, 
0.4667, 0.4000, 0.4000, 0.4000, 0.2667, 0.2000, 0.0667, 0.0000, 0.0000, 
0.0000, 0.2000, 0.4667, 0.4667, 0.4000, 0.4000, 0.2000, 0.0000, 0.0000, 
0.0000},
{0.4667, 0.5333, 0.6000, 0.6000, 0.6000, 0.4000, 0.2667, 0.3333, 0.4000, 
0.4667, 0.5333, 0.6000, 0.6000, 0.6000, 0.6667, 0.6667, 0.6667, 0.6667, 
0.7333, 0.7333, 0.7333, 0.6667, 0.4667, 0.4667, 0.5333, 0.6000, 0.6000, 
0.7333, 0.7333, 0.7333, 0.6667, 0.5333, 0.5333, 0.4667, 0.3333, 0.3333, 
0.6000, 0.7333, 0.7333, 0.7333, 0.6667, 0.6000, 0.6000, 0.5333, 0.5333, 
0.4667, 0.4667, 0.4000, 0.4000, 0.2667, 0.2000, 0.1333, 0.0000, 0.0000, 
0.0000, 0.1333, 0.4667, 0.5333, 0.4667, 0.4000, 0.2667, 0.0667, 0.0000, 
0.0000},
{0.5333, 0.6000, 0.6000, 0.6667, 0.5333, 0.4000, 0.2667, 0.3333, 0.4000, 
0.4667, 0.5333, 0.5333, 0.5333, 0.6000, 0.5333, 0.6000, 0.6667, 0.6667, 
0.6667, 0.6667, 0.7333, 0.6667, 0.4667, 0.3333, 0.4000, 0.5333, 0.6000, 
0.7333, 0.7333, 0.7333, 0.6667, 0.5333, 0.4000, 0.3333, 0.2000, 0.3333, 
0.6000, 0.7333, 0.6667, 0.6667, 0.6000, 0.5333, 0.6000, 0.5333, 0.4667, 
0.4667, 0.4000, 0.4000, 0.3333, 0.2667, 0.2000, 0.1333, 0.0000, 0.0000, 
0.0000, 0.0667, 0.3333, 0.5333, 0.4667, 0.3333, 0.2000, 0.0667, 0.0000, 
0.0000},
{0.5333, 0.6000, 0.6667, 0.7333, 0.5333, 0.3333, 0.3333, 0.3333, 0.4000, 
0.4667, 0.5333, 0.6000, 0.5333, 0.5333, 0.6000, 0.5333, 0.6000, 0.6667, 
0.6000, 0.6667, 0.7333, 0.6667, 0.5333, 0.3333, 0.2667, 0.4000, 0.5333, 
0.6000, 0.6000, 0.6000, 0.5333, 0.4667, 0.3333, 0.2000, 0.2667, 0.4667, 
0.6667, 0.6667, 0.6000, 0.5333, 0.6000, 0.6000, 0.6000, 0.5333, 0.4667, 
0.4000, 0.3333, 0.3333, 0.3333, 0.2667, 0.2000, 0.1333, 0.0000, 0.0000, 
0.0000, 0.0000, 0.1333, 0.4000, 0.4000, 0.2667, 0.2000, 0.1333, 0.0000, 
0.0000},
{0.4667, 0.5333, 0.6667, 0.6667, 0.5333, 0.3333, 0.2667, 0.3333, 0.4000, 
0.4667, 0.5333, 0.5333, 0.5333, 0.5333, 0.6000, 0.6000, 0.5333, 0.6000, 
0.6000, 0.6000, 0.6000, 0.6667, 0.5333, 0.4000, 0.3333, 0.3333, 0.4000, 
0.4667, 0.5333, 0.4667, 0.4000, 0.3333, 0.2667, 0.2667, 0.4000, 0.5333, 
0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.5333, 0.5333, 0.4667, 
0.4000, 0.3333, 0.3333, 0.3333, 0.2667, 0.2000, 0.2000, 0.0667, 0.0000, 
0.0000, 0.0000, 0.0667, 0.3333, 0.3333, 0.3333, 0.2667, 0.2667, 0.0667, 
0.0000},
{0.4000, 0.4000, 0.5333, 0.5333, 0.4667, 0.3333, 0.3333, 0.4000, 0.4667, 
0.4667, 0.4667, 0.5333, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 
0.6000, 0.6000, 0.5333, 0.5333, 0.5333, 0.4667, 0.3333, 0.2667, 0.3333, 
0.4000, 0.4667, 0.4000, 0.3333, 0.3333, 0.3333, 0.3333, 0.4000, 0.5333, 
0.5333, 0.5333, 0.5333, 0.6000, 0.5333, 0.6000, 0.5333, 0.5333, 0.5333, 
0.4667, 0.4000, 0.4000, 0.4000, 0.3333, 0.3333, 0.2000, 0.0667, 0.0000, 
0.0000, 0.0000, 0.1333, 0.4000, 0.4667, 0.5333, 0.4667, 0.4000, 0.2667, 
0.0000},
{0.4667, 0.5333, 0.6000, 0.5333, 0.4000, 0.2667, 0.2667, 0.4000, 0.4667, 
0.5333, 0.4667, 0.5333, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 
0.6000, 0.5333, 0.4667, 0.5333, 0.5333, 0.4667, 0.3333, 0.2667, 0.3333, 
0.4000, 0.4000, 0.4000, 0.4000, 0.3333, 0.3333, 0.3333, 0.4000, 0.4667, 
0.4667, 0.5333, 0.5333, 0.5333, 0.5333, 0.5333, 0.5333, 0.4667, 0.5333, 
0.4667, 0.4000, 0.4000, 0.4000, 0.3333, 0.2667, 0.2000, 0.0667, 0.0000, 
0.0000, 0.0000, 0.1333, 0.3333, 0.4667, 0.6667, 0.6000, 0.5333, 0.4000, 
0.0667},
{0.6000, 0.6667, 0.6667, 0.6000, 0.4000, 0.2667, 0.3333, 0.4000, 0.4667, 
0.5333, 0.4667, 0.5333, 0.5333, 0.6000, 0.6000, 0.5333, 0.6000, 0.6000, 
0.6000, 0.5333, 0.5333, 0.4667, 0.4667, 0.4667, 0.4000, 0.3333, 0.4000, 
0.4667, 0.4667, 0.4667, 0.4667, 0.4000, 0.3333, 0.3333, 0.3333, 0.4000, 
0.4000, 0.4667, 0.5333, 0.5333, 0.4667, 0.4667, 0.4667, 0.5333, 0.5333, 
0.4667, 0.4000, 0.4000, 0.4000, 0.4000, 0.2667, 0.2000, 0.1333, 0.0000, 
0.0000, 0.0000, 0.0000, 0.2667, 0.5333, 0.6667, 0.6667, 0.6000, 0.4667, 
0.1333},
{0.7333, 0.7333, 0.6667, 0.6000, 0.4000, 0.2667, 0.3333, 0.4000, 0.4667, 
0.5333, 0.4667, 0.5333, 0.5333, 0.5333, 0.6000, 0.6000, 0.6000, 0.6000, 
0.6000, 0.6000, 0.5333, 0.4667, 0.4667, 0.4000, 0.4000, 0.3333, 0.3333, 
0.4667, 0.5333, 0.5333, 0.5333, 0.4667, 0.3333, 0.2667, 0.2667, 0.3333, 
0.4000, 0.4667, 0.4667, 0.5333, 0.5333, 0.5333, 0.5333, 0.5333, 0.5333, 
0.4667, 0.4667, 0.4000, 0.4000, 0.3333, 0.3333, 0.2000, 0.1333, 0.0667, 
0.0000, 0.0000, 0.0000, 0.2000, 0.5333, 0.6667, 0.6667, 0.6000, 0.4667, 
0.1333},
{0.8000, 0.8000, 0.7333, 0.5333, 0.4000, 0.3333, 0.3333, 0.3333, 0.4000, 
0.4667, 0.4667, 0.4667, 0.6000, 0.6000, 0.6000, 0.6667, 0.6667, 0.6667, 
0.6667, 0.6667, 0.6000, 0.5333, 0.4667, 0.4000, 0.3333, 0.3333, 0.4000, 
0.4667, 0.5333, 0.6000, 0.6000, 0.4667, 0.3333, 0.2667, 0.3333, 0.3333, 
0.4667, 0.5333, 0.5333, 0.5333, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 
0.5333, 0.5333, 0.4667, 0.4000, 0.3333, 0.2667, 0.2000, 0.2000, 0.0667, 
0.0000, 0.0000, 0.0000, 0.0667, 0.4000, 0.5333, 0.6000, 0.5333, 0.4000, 
0.2000},
{0.7333, 0.7333, 0.7333, 0.5333, 0.3333, 0.2667, 0.4000, 0.4000, 0.4000, 
0.4667, 0.5333, 0.5333, 0.6000, 0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 
0.7333, 0.6667, 0.6000, 0.6000, 0.5333, 0.4000, 0.3333, 0.3333, 0.4000, 
0.4667, 0.5333, 0.6000, 0.5333, 0.4667, 0.3333, 0.2667, 0.3333, 0.4000, 
0.4667, 0.5333, 0.5333, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 
0.5333, 0.5333, 0.4667, 0.4000, 0.3333, 0.2667, 0.2667, 0.2000, 0.1333, 
0.0000, 0.0000, 0.0000, 0.0000, 0.1333, 0.4000, 0.4667, 0.4667, 0.2667, 
0.2667},
{0.6667, 0.6667, 0.6667, 0.5333, 0.3333, 0.2667, 0.3333, 0.4667, 0.4000, 
0.4000, 0.5333, 0.6000, 0.6000, 0.6000, 0.6000, 0.6667, 0.6667, 0.6667, 
0.6667, 0.7333, 0.6667, 0.6667, 0.6000, 0.4667, 0.4000, 0.3333, 0.4000, 
0.4667, 0.5333, 0.6000, 0.6000, 0.5333, 0.4000, 0.3333, 0.3333, 0.4667, 
0.5333, 0.6000, 0.6000, 0.6667, 0.6667, 0.6000, 0.5333, 0.4667, 0.5333, 
0.4667, 0.4667, 0.4000, 0.4000, 0.4000, 0.3333, 0.2667, 0.2000, 0.1333, 
0.0667, 0.0000, 0.0000, 0.0000, 0.0000, 0.2667, 0.4000, 0.2667, 0.2667, 
0.3333},
{0.6667, 0.6000, 0.4667, 0.4000, 0.2667, 0.2667, 0.3333, 0.4000, 0.4000, 
0.4667, 0.5333, 0.5333, 0.5333, 0.5333, 0.6000, 0.6000, 0.6000, 0.6000, 
0.6000, 0.6667, 0.7333, 0.6667, 0.6667, 0.5333, 0.4667, 0.4000, 0.4667, 
0.5333, 0.6000, 0.6667, 0.6000, 0.5333, 0.4000, 0.3333, 0.4000, 0.4667, 
0.4667, 0.5333, 0.6667, 0.6667, 0.5333, 0.4000, 0.3333, 0.4000, 0.4000, 
0.4000, 0.3333, 0.3333, 0.3333, 0.3333, 0.2667, 0.2667, 0.2667, 0.2000, 
0.0667, 0.0000, 0.0000, 0.0000, 0.0000, 0.0667, 0.2000, 0.2000, 0.3333, 
0.4000},
{0.6000, 0.5333, 0.4000, 0.3333, 0.2667, 0.2000, 0.3333, 0.4667, 0.4667, 
0.4667, 0.5333, 0.4667, 0.4667, 0.4667, 0.5333, 0.6000, 0.5333, 0.2667, 
0.2667, 0.4667, 0.6667, 0.8000, 0.7333, 0.6000, 0.4667, 0.4667, 0.5333, 
0.6000, 0.6667, 0.7333, 0.7333, 0.6667, 0.4667, 0.4000, 0.4000, 0.4000, 
0.4667, 0.6000, 0.6667, 0.6000, 0.2000, 0.0000, 0.0000, 0.2000, 0.4000, 
0.4000, 0.2667, 0.2667, 0.2000, 0.2000, 0.2667, 0.2667, 0.2667, 0.1333, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0667, 0.2000, 0.3333, 
0.4000},
{0.6000, 0.5333, 0.2667, 0.2000, 0.2000, 0.2000, 0.3333, 0.4667, 0.5333, 
0.4667, 0.4000, 0.4000, 0.3333, 0.4000, 0.5333, 0.6000, 0.2667, 0.0000, 
0.0000, 0.0667, 0.5333, 0.7333, 0.7333, 0.5333, 0.4000, 0.4667, 0.5333, 
0.6667, 0.6667, 0.7333, 0.7333, 0.6667, 0.5333, 0.4000, 0.3333, 0.3333, 
0.4000, 0.6000, 0.6667, 0.4000, 0.0667, 0.0667, 0.0000, 0.0000, 0.2667, 
0.4000, 0.1333, 0.0667, 0.0667, 0.2000, 0.2667, 0.2667, 0.2000, 0.0667, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.2000, 0.2667, 
0.3333},
{0.6000, 0.4667, 0.1333, 0.0667, 0.0667, 0.1333, 0.2667, 0.4667, 0.4667, 
0.5333, 0.4667, 0.4000, 0.2667, 0.2000, 0.4000, 0.4667, 0.1333, 0.0000, 
0.0000, 0.0000, 0.2000, 0.5333, 0.6000, 0.5333, 0.5333, 0.5333, 0.6667, 
0.6667, 0.7333, 0.8000, 0.7333, 0.6667, 0.6000, 0.5333, 0.4000, 0.3333, 
0.4000, 0.4667, 0.5333, 0.2000, 0.0000, 0.1333, 0.0667, 0.0000, 0.0667, 
0.0667, 0.0000, 0.0000, 0.2000, 0.2667, 0.2667, 0.2667, 0.1333, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.2000, 0.2667, 
0.1333},
{0.4000, 0.2000, 0.0000, 0.0000, 0.0000, 0.0667, 0.2000, 0.3333, 0.4667, 
0.4667, 0.4667, 0.5333, 0.4000, 0.2667, 0.2667, 0.2667, 0.0667, 0.0000, 
0.0000, 0.0000, 0.1333, 0.4667, 0.5333, 0.5333, 0.6000, 0.6000, 0.6667, 
0.7333, 0.7333, 0.8000, 0.7333, 0.7333, 0.6667, 0.6000, 0.4667, 0.4667, 
0.4667, 0.4000, 0.4000, 0.2667, 0.0667, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0667, 0.0667, 0.2000, 0.2667, 0.3333, 0.2667, 0.1333, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0667, 0.1333, 
0.0667},
{0.1333, 0.0000, 0.0000, 0.0000, 0.0000, 0.0667, 0.2000, 0.2667, 0.4000, 
0.5333, 0.5333, 0.5333, 0.5333, 0.4667, 0.4667, 0.4000, 0.2667, 0.2667, 
0.2667, 0.3333, 0.4000, 0.5333, 0.5333, 0.6000, 0.6667, 0.6667, 0.7333, 
0.7333, 0.7333, 0.8000, 0.8000, 0.7333, 0.7333, 0.6667, 0.6000, 0.5333, 
0.5333, 0.4667, 0.4000, 0.3333, 0.3333, 0.3333, 0.2667, 0.2000, 0.2000, 
0.2667, 0.3333, 0.3333, 0.3333, 0.4000, 0.2667, 0.1333, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000},
{0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1333, 0.2000, 0.3333, 
0.4667, 0.5333, 0.6000, 0.6000, 0.6000, 0.6000, 0.5333, 0.5333, 0.5333, 
0.5333, 0.5333, 0.5333, 0.6000, 0.6667, 0.6667, 0.6667, 0.7333, 0.7333, 
0.7333, 0.8000, 0.8000, 0.8000, 0.7333, 0.7333, 0.7333, 0.6667, 0.6000, 
0.5333, 0.5333, 0.4667, 0.4667, 0.4000, 0.4000, 0.4000, 0.4000, 0.4000, 
0.4000, 0.4000, 0.4667, 0.4000, 0.3333, 0.2667, 0.1333, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000},
{0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0667, 0.1333, 0.3333, 
0.4667, 0.5333, 0.6000, 0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 0.6000, 
0.6000, 0.6000, 0.6000, 0.6000, 0.6667, 0.7333, 0.7333, 0.7333, 0.7333, 
0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.7333, 0.7333, 0.7333, 0.6667, 
0.6000, 0.6000, 0.5333, 0.5333, 0.5333, 0.5333, 0.5333, 0.5333, 0.5333, 
0.5333, 0.5333, 0.5333, 0.4667, 0.4000, 0.2667, 0.0667, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000},
{0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0667, 0.2000, 
0.4000, 0.5333, 0.6000, 0.6667, 0.7333, 0.7333, 0.7333, 0.6667, 0.6667, 
0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 0.7333, 0.7333, 0.8000, 0.8000, 
0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.7333, 0.7333, 0.7333, 0.7333, 
0.6667, 0.6667, 0.5333, 0.5333, 0.6000, 0.5333, 0.6000, 0.6000, 0.6000, 
0.6000, 0.6000, 0.5333, 0.4667, 0.4000, 0.2667, 0.0667, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000},
{0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0667, 
0.2667, 0.4000, 0.5333, 0.6000, 0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 
0.6667, 0.6667, 0.6667, 0.7333, 0.7333, 0.8000, 0.8000, 0.8000, 0.8000, 
0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.7333, 0.7333, 0.8000, 0.7333, 
0.7333, 0.6667, 0.6000, 0.5333, 0.5333, 0.5333, 0.6000, 0.6000, 0.5333, 
0.5333, 0.5333, 0.5333, 0.4667, 0.3333, 0.1333, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000},
{0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.1333, 0.2667, 0.4000, 0.5333, 0.5333, 0.6000, 0.6667, 0.6667, 0.6667, 
0.7333, 0.7333, 0.7333, 0.7333, 0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 
0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 
0.7333, 0.7333, 0.7333, 0.6667, 0.6000, 0.6000, 0.6000, 0.5333, 0.4667, 
0.5333, 0.4667, 0.4667, 0.4000, 0.2000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000},
{0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0667, 0.2000, 0.2667, 0.4000, 0.5333, 0.6000, 0.6667, 0.6667, 0.7333, 
0.7333, 0.7333, 0.7333, 0.8000, 0.8000, 0.7333, 0.8000, 0.8000, 0.8000, 
0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.7333, 
0.7333, 0.7333, 0.7333, 0.6667, 0.6667, 0.6667, 0.6000, 0.5333, 0.4667, 
0.4667, 0.4000, 0.4000, 0.2667, 0.1333, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000},
{0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.1333, 0.2000, 0.3333, 0.4000, 0.4667, 0.5333, 0.6000, 0.6667, 0.6667, 
0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.8000, 0.8000, 0.8000, 
0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.7333, 0.7333, 
0.7333, 0.7333, 0.7333, 0.6667, 0.6667, 0.6000, 0.6000, 0.5333, 0.5333, 
0.4667, 0.4000, 0.3333, 0.2667, 0.1333, 0.0667, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000},
{0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.1333, 0.2667, 0.3333, 0.4000, 0.4667, 0.5333, 0.6000, 0.6667, 0.6667, 
0.6667, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.8000, 0.8000, 
0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.7333, 0.7333, 0.7333, 
0.7333, 0.6667, 0.6667, 0.6667, 0.6000, 0.6000, 0.5333, 0.4667, 0.4667, 
0.4000, 0.3333, 0.2667, 0.2000, 0.1333, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000},
{0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.1333, 0.2667, 0.3333, 0.4000, 0.4667, 0.5333, 0.6000, 0.6667, 0.6667, 
0.6667, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.8000, 0.8000, 
0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.7333, 0.7333, 0.7333, 
0.6667, 0.6000, 0.6667, 0.6000, 0.5333, 0.6000, 0.5333, 0.4667, 0.4667, 
0.4667, 0.4000, 0.3333, 0.2667, 0.1333, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000},
{0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0667, 0.2000, 0.3333, 0.4000, 0.4667, 0.4667, 0.6000, 0.6000, 0.6667, 
0.6667, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.8000, 0.8000, 
0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.7333, 0.7333, 0.7333, 0.6667, 
0.6667, 0.6667, 0.6667, 0.6000, 0.6000, 0.6000, 0.5333, 0.4667, 0.4667, 
0.4000, 0.4000, 0.3333, 0.2667, 0.1333, 0.0667, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000},
{0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0667, 0.2000, 0.2667, 0.3333, 0.4667, 0.5333, 0.5333, 0.6000, 0.6667, 
0.6667, 0.6667, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.8000, 0.8000, 
0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.7333, 0.7333, 0.7333, 0.6667, 
0.6667, 0.6667, 0.6000, 0.6000, 0.6000, 0.6000, 0.5333, 0.4667, 0.4667, 
0.4000, 0.3333, 0.2667, 0.2000, 0.1333, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000},
{0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000, 0.2000, 0.2667, 0.3333, 0.4667, 0.5333, 0.5333, 0.6000, 0.6667, 
0.6667, 0.6667, 0.6667, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.8000, 
0.8000, 0.8000, 0.8000, 0.8000, 0.7333, 0.7333, 0.7333, 0.7333, 0.6667, 
0.6667, 0.6667, 0.6000, 0.6000, 0.6000, 0.5333, 0.5333, 0.4667, 0.4667, 
0.4000, 0.3333, 0.2667, 0.2000, 0.1333, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000},
{0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000, 0.1333, 0.2667, 0.3333, 0.4000, 0.4667, 0.5333, 0.6000, 0.6000, 
0.6667, 0.6667, 0.6667, 0.7333, 0.7333, 0.7333, 0.7333, 0.8000, 0.8000, 
0.7333, 0.7333, 0.8000, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 
0.6667, 0.6667, 0.6667, 0.6000, 0.6000, 0.5333, 0.4667, 0.4667, 0.4667, 
0.4000, 0.3333, 0.2667, 0.2000, 0.0667, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000},
{0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0667, 0.2000, 0.3333, 0.4000, 0.4667, 0.5333, 0.6000, 0.6000, 
0.6667, 0.6667, 0.6667, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 
0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 
0.6667, 0.6667, 0.6667, 0.6000, 0.6000, 0.5333, 0.4667, 0.4667, 0.4000, 
0.3333, 0.2667, 0.2667, 0.2000, 0.0667, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000},
{0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.1333, 0.2667, 0.4000, 0.4667, 0.5333, 0.6000, 0.6000, 
0.6667, 0.6667, 0.6667, 0.6667, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 
0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 
0.6000, 0.6667, 0.6000, 0.5333, 0.6000, 0.5333, 0.5333, 0.4667, 0.4000, 
0.3333, 0.2667, 0.2000, 0.2000, 0.0667, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000},
{0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0667, 0.2000, 0.3333, 0.4000, 0.4667, 0.5333, 0.6000, 
0.6000, 0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 0.7333, 0.7333, 0.7333, 
0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.7333, 0.6667, 0.6667, 
0.6667, 0.6667, 0.6000, 0.6000, 0.6000, 0.5333, 0.4667, 0.4667, 0.4000, 
0.4000, 0.3333, 0.2667, 0.1333, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000},
{0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0667, 0.2000, 0.3333, 0.4000, 0.4667, 0.5333, 
0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.6667, 0.6667, 0.6667, 0.6667, 
0.6667, 0.7333, 0.7333, 0.6667, 0.7333, 0.7333, 0.6667, 0.6000, 0.6667, 
0.6667, 0.6000, 0.5333, 0.6000, 0.5333, 0.5333, 0.4667, 0.4000, 0.4000, 
0.3333, 0.2667, 0.2000, 0.0667, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000},
{0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.1333, 0.2667, 0.3333, 0.4667, 0.5333, 
0.5333, 0.6000, 0.5333, 0.6000, 0.6667, 0.6667, 0.6667, 0.6000, 0.6667, 
0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 0.6667, 
0.6000, 0.5333, 0.6000, 0.5333, 0.5333, 0.5333, 0.4667, 0.4000, 0.4000, 
0.3333, 0.2667, 0.1333, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000},
{0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1333, 0.3333, 0.4000, 0.5333, 
0.4667, 0.5333, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 0.6000, 
0.6667, 0.6667, 0.6667, 0.6667, 0.6000, 0.6667, 0.6667, 0.6667, 0.6000, 
0.5333, 0.6000, 0.5333, 0.5333, 0.5333, 0.4667, 0.4000, 0.4000, 0.4000, 
0.3333, 0.1333, 0.0667, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 
0.0000}};

width=Dimensions[face][[1]]; size=width;
hsize=(width/2);hfwidth=hsize;height=Dimensions[face][[2]];face;gface=ArrayPlot[face];

Computing both the first and second derivatives of image intensity can be thought of as filters to pick out regions of an image that have "salient", i.e. rapid, intensity changes. A natural extension is to look at all four combinations of second derivatives.

Calculating the Hessian of an image using function interpolation

The Hessian of a function f, H(f) is given by:

For our purposes, {(Subscript[x, 1]),(Subscript[x, 2])} = {x,y}, so the Hessian of an image returns a 2x2 matrix at each point (x,y) that represents the four combinations of second derivatives in the x and y directions. The determinant of each of the 2x2 matrices provides a scalar which is a measure of the "area" of each 2x2 matrix. The area can be used as a rough measure of saliency or local "interest", which takes into account rates of change in x and y, for example at "corners". 

For more information about interest operators in computer vision, read about the SIFT filter (Lowe, 1999).

Let filterface = f, where we' ve blurred out face a little to reduce quantization artifacts :

kernel = N[{{1, 1, 1}, {1, 1, 1}, {1, 1, 1}}]; 
filterface = ListConvolve[kernel, face];

faceFunction = ListInterpolation[Transpose[filterface], {{-1, 1}, {-1, 1}}];

hessian[x_, y_] := Evaluate[D[faceFunction[x, y], {{x, y}, 2}]];

Calculate and plot each of the components of the Hessian at each image point

dxxtemp = Table[hessian[x, y][[1,2]], {x, -1, 1, 0.005}, {y, -1, 1, 0.005}];

GraphicsRow[{gface,ArrayPlot[Transpose[dxxtemp]],Histogram[Flatten[dxxtemp]]}]

The determinant of the Hessian provides a simple measure of "salience" (See Torralba et al., 2006 for different model of salience, and an application to human vision.)

htemp = Table[Det[hessian[x, y]], {x, -1, 1, 0.005}, {y, -1, 1, 0.005}];

GraphicsRow[{gface,ArrayPlot[Transpose[htemp]],Histogram[Flatten[htemp]]}]

For current computer vision work on local feature detection, see papers by Lowe in the references, and      http://en.wikipedia.org/wiki/Scale-invariant_feature_transform

Also see: http://en.wikipedia.org/wiki/Interest_point_detection

Derivative filters

See http://gandalf.psych.umn.edu/~kersten/kersten-lab/courses/Psy5036W2004/Lectures/8.%20Spatial%20filters/Fourier_neural_image.nb.

gauss[x_,y_,σ_]:=(1/(2π (σ^2))) Exp[((-((x^2)+(y^2)))/(2 (σ^2)))];

derivativeGauss[x_,y_,j_,k_,σ_]:=D[gauss[x,y,σ],{x,j},{y,k}];

derivativeGausskernel[j_,k_,σ_,xwidth_,ywidth_]:=N[Table[Evaluate[derivativeGauss[x,y,j,k,σ]],{y,((-(ywidth-1))/2),((ywidth-1)/2)},{x,((-(xwidth-1))/2),((xwidth-1)/2)}]];

gaussD[image_,j_,k_,σ_]:=
	Module[{xwidth,ywidth,kernel},
		{ywidth,xwidth}=Dimensions[image];
		kernel=RotateLeft[derivativeGausskernel[j,k,σ,xwidth,ywidth],{ywidth/2,xwidth/2}];
		Chop[N[InverseFourier[Fourier[image] Fourier[kernel]]]]];

First derivative filter in x direction

xwidth=16; ywidth=16;
ArrayPlot[derivativeGausskernel[1,0,4,xwidth,ywidth],Mesh->False];

Take first x derivative of gaussian filtered image:

ArrayPlot[gaussD[face,1,0,1],Mesh->False,Frame->False];

Second derivative filter in x direction

xwidth=16; ywidth=16;
ArrayPlot[derivativeGausskernel[2,0,4,xwidth,ywidth],Mesh->False];

Laplacian revisited

Recall that the (∇^2)G operator is given by the Laplacian of a gaussian, G(x,y):

(∇^2)G=((∂^2)/(∂(x^2)))G(x,y) + ((∂^2)/(∂(y^2)))G(x,y)

Thus,  the convoloution, (∇^2)G*face, is given by:

laplacian[image_,σ_]:=-gaussD[image,2,0,σ]-gaussD[image,0,2,σ];

gdelsqimage=ArrayPlot[delsqimage=laplacian[face,2],Mesh->False,Frame->False];

contours = ListContourPlot[delsqimage,Contours->{0},ContourShading->False,ContourStyle->{Thickness[0.003],RGBColor[1,0,0]},DisplayFunction->Identity];
Show[{gdelsqimage,contours}];

Morrone & Burr: polarity sensitive & polarity insensitive

Morrone and Burr edge/bar detectors

Suppose we convolve an input signal with an even filter (e.g. Gaussian enveloped cosine-wave) to produce reponse Re, and then convolve the same input with an odd filter (say, a Gaussian enveloped sine-wave) to produce response Ro. The filters are orthogonal to each other, and so are the responses. Re will tend to peak at "bars" in the image whose size is near half the period of the cosine-wave. Ro will tend to peak near edges.
	The local contrast "energy" is defined to be: Sqrt[Re^2 + Ro^2]. Morrone and Burr showed that the local energy peaks where the Fourier components of an image line up with zero-phase--i.e. at points where the various Fourier components are all in sine-phase. These points are edges. But it also peaks near bar features, arguably also interesting image features where the phase coherence is at 90 degrees. In addition to its neurophysiological appeal, a particularly attractive feature of this model is that if one adds up responses over multiple spatial scales, evidence accumulates for edges because the local energy peaks coincide there. They also showed how their model could be used to explain Mach bands.

Mach bands & the Morrone & Burr edge detector

size = 256;Clear[y];
low = 0.2; hi = 0.8;
y[x_] := low /; x<size/3
y[x_] :=
	((hi-low)/(size/3)) x + (low-(hi-low)) /; x>=size/3 && x<2*size/3
y[x_] := hi /; x>2*size/3
Plot[y[x],{x,0,256},PlotRange->{0,1}];

picture = Table[Table[y[i],{i,1,size}],{i,1,size}];
ArrayPlot[picture,Frame->False,Mesh->False, 
				PlotRange->{0,1}, AspectRatio->Automatic];

Gabor filters

sgabor[x_,y_,fx_,fy_,sig_]:=N[Exp[(-x^2-y^2)/(2 sig*sig)] Sin[2 Pi (fx x+fy y)]];
cgabor[x_,y_,fx_,fy_,sig_]:=N[Exp[(-x^2-y^2)/(2 sig*sig)] Cos[2 Pi (fx x+fy y)]];

fsize = 32;sfilter=Table[sgabor[(i-fsize/2),(j-fsize/2),0,1/8,4],{i,0,fsize},{j,0,fsize}];
sfilter = Chop[sfilter];
g10=ArrayPlot[sfilter,Mesh->False,PlotRange->{-1,1},Frame->False];

fsize = 32;cfilter=Table[cgabor[(i-fsize/2),(j-fsize/2),0,1/8,4],{i,0,fsize},{j,0,fsize}];
cfilter = Chop[cfilter];
g11=ArrayPlot[cfilter,Mesh->False,PlotRange->{-1,1},Frame->False];

Apply odd (sine) filter

fspicture = ListConvolve[sfilter, picture];
ArrayPlot[fspicture,Mesh->False];

Apply even (cosine) filter

fcpicture = ListConvolve[cfilter, picture];
ArrayPlot[fcpicture,Mesh->False];

Look for peaks in local contrast energy

ss = Sqrt[fspicture^2 +fcpicture^2];

ArrayPlot[ss,Mesh->False];

ListPlot[ss[[128]]];

Two cylinders, no illusion

twoc = Import["TwoCylinders.tiff"][[1,1]];
reds=twoc[[All,All,2]];
Dimensions[reds]

ArrayPlot[reds]
ListPlot[reds[[Dimensions[reds][[1]]/2]]]

References

Buchsbaum, G., & Gottschalk, A. (1983). Trichromacy, Opponent Colour Coding and Optimum Information Transmission in the Retina. Proc. Roy. Soc. Lond. B, 220, 89-113.
Carandini, M., Heeger, D. J., & Movshon, J. A. (1997). Linearity and normalization in simple cells of the macaque primary visual cortex. J Neurosci, 17(21), 8621-44.
Canny, J. F. (1986). A Computational Approach to Edge Detection. IEEE Transactions on Pattern Analysis and Machine Intelligence, 8((6)), 679-698.
Chen, H. F., Belhumeur, P. N., & Jacobs, D. W. (2000). In search of illumination invariants. Proceedings of IEEE Computer Society Conference on Computer Vision and Pattern Recognition, 1, 254--261.
Hallinan, P. W. (1994). A low-dimensional lighting representation of human faces for  arbitrary lighting conditions. Paper presented at the IEEE Conf. on Computer Vision and Pattern Recognition, Seattle.
Marr, D., & Hildreth, E. (1980). Theory of Edge Detection. Proceedings of the Royal Society of London, B207, 187-217.
Morrone, M. C., & Burr, D. (1988). Feature detection in human vision: a phase dependent energy model. Proceedings of the Royal Society, London, 235, 221-245.
Gaska, J. P., Pollen, D. A., & Cavanagh, P. (1987). Diversity of complex cell responses to even- and odd-symmetric luminance profiles in the visual cortex of the cat. Exp Brain Res, 68(2), 249-59.
Field, D. J., & Tolhurst, D. J. (1986). The structure and symmetry of simple-cell receptive-field profiles in the cat's visual cortex. Proc. R. Soc. Lond., 228(B), 379-400.
Foldiak, P. (1989). Adaptive network for optimal linear feature extraction. Paper presented at the IEEE/ INNS International Joint Conference on Neural Networks, Washington D. C.
Horn, B. K. P. (1986). Robot Vision. Cambridge MA: MIT Press.
Kammen, D. M., & Yuille, A. L. (1988). Spontaneous Summetry-Breaking Energy Functions and the Emergence of Orientation Selective Cortical Cells. Biological Cybernetics, 59, 23-31.
Knill, D. C., & Kersten, D. (1991). Apparent surface curvature affects lightness perception. Nature, 351, 228-230.
Konishi, S. M., Yuille, A. L., Coughlan, J. M., & Zhu, S. C. (2003). Statistical edge detection: Learning and evaluating edge cues. IEEE Transactions on Pattern Analysis and Machine Intelligence, 25(1), 57-74.
Liu, Z., Gaska, J. P., Jacobson, L. D., & Pollen, D. A. (1992). Interneuronal interaction between members of quadrature phase and anti- phase pairs in the cat's visual cortex. Vision Res, 32(7), 1193-8.
Lowe, David G.(1999)."Object recognition from local scale-invariant features".Proceedings of the International Conference on Computer Vision 2 : 1150 –1157.doi : 10.1109/ICCV .1999 .790410.
Lowe, D.G., “Distinctive image features from scale - invariant keypoints”, International Journal of Computer Vision, 60, 2, pp.91 - 110, 2004.
Malik, J., Belongie, S., Leung, S. H., & Shi, J. (2001). Contour and Texture Analysis for Image Segmentation. International Journal of Computer Vision, 43(1), 7–27.
Olshausen, B. A., & Field, D. J. (1996). Emergence of simple-cell receptive field properties by learning a sparse code for natural images. Nature, 381, 607-609.
Sanger, T. (1989). Optimal unsupervised learning in a single-layer linear feedforward neural network. Neural Networks, 2, 459-473.
Sanger, T. D. (1990). Analysis of the Two-Dimensional Receptive Fields Learned by the Generalized Hebbian Algorithm in Response to Random Input. Biological Cybernetics, 63(MIT), 221-228.
Torralba, A., Oliva, A., Castelhano, M. S., & Henderson, J. M. (2006). Contextual guidance of eye movements and attention in real-world scenes: the role of global features in object search. Psychol Rev, 113(4), 766-786.
Tu, Z., & Zhu, S.-C. (2002). Image Segmentation by Data-Driven Markov Chain Monte Carlo. IEEE Trans. on Pattern Analysis and Machine Intelligence, 24(5), 657-673.
Watt, R. J., & Morgan, M. J. (1983). The Recognition and Representation of Edge Blur: Evidence for Spatial Primitives in Human Vision. Vision Research, 23(12), 1465-1477.
Yuille, A. L., Kammen, D. M., & Cohen, D. S. (1989). Quadrature and the development of orientation selective cortical cells by Hebb rules. Biological Cybernetics, 61, 183-194.